//
// Created by jsjxsy on 2022/8/15.
//
#include <string>
#include <iostream>
using namespace std;
class Wife;
class Husband {
 public:
  string name;
  Husband(double s = 20000.10, string n = "zhang san") : salary(s), name(n) {}
  ~Husband();
 private:
  double salary;
 public:
   friend static void visit(Wife &wife, Husband &husband);
};

class Wife {
  friend class Husband;
 public:
  string name;
  Wife();
  ~Wife();
 private:
  double salary;
 public:
  friend void visit(Wife &wife, Husband &husband);
};
Husband::~Husband() {
  cout << "~Husband()" << endl;
}

Wife::Wife() {
  this->name = "xiao mei";
  this->salary = 15000.19f;
}

Wife::~Wife() {
  cout << "~Wife()" << endl;
}

inline void visit(Wife &wife, Husband &husband) {
  cout << "wife name:" << wife.name << endl
       << "salary:" << wife.salary << endl
       << "husband name:" << husband.name << endl
       << "salary:" << husband.salary << endl;
}

int main(void) {
  Husband husband;
  Wife wife;
  visit(wife, husband);
  return 0;
}